#import "TopicModel.h"

@implementation TopicModel

@synthesize topicId;
@synthesize topicTime;
@synthesize topicTitle;
@synthesize topicText;
@synthesize topicImgUrl;
@synthesize topicImg;
@synthesize topicContent;
@synthesize replies;

-(id)init{
    self = [super init];
    if(self){
        topicImg = nil;
        replies = [[NSMutableArray alloc] init];
        topicContent = [[NSMutableArray alloc] init];
    }
    return self;
}

- (id)copyWithZone:(NSZone *)zone {
    TopicModel *copy = [[[self class] allocWithZone:zone] init];
    copy.topicId = self.topicId;
    copy.topicTime = self.topicTime;
    copy.topicTitle = self.topicTitle;
    copy.topicImgUrl = self.topicImgUrl;
    copy.topicText = self.topicText;
    return copy;
}

-(void)dealloc
{
    PP_RELEASE(topicId);
    PP_RELEASE(topicTime);
    PP_RELEASE(topicTitle);
    PP_RELEASE(topicText);
    PP_RELEASE(topicImgUrl);
    PP_RELEASE(topicImg);
    PP_RELEASE(topicContent);
    PP_RELEASE(replies);    
    [super dealloc];
}

-(void)printTopic
{
    Log(@"topicmodel <prinself> %@ %@ %@ %@ %@ ",self.topicId,self.topicImgUrl,self.topicTitle,self.topicText,self.topicTime);
}
@end

